package cn.edu.zafu.bigdata.x.yaojy;

public class TestCube {
    public static void main(String[] args) {
        Cube cube1 = new Cube(1.2,2.3,3.6);
        Cube cube2 = new Cube(1.2,2.3,3.6);
        Cube cube3 = new Cube(8.1,7.2,3.6);
        Cube cube4 = cube2;

        System.out.println("cube1与cube2是否相等：" + cube1.equals(cube2));
        System.out.println("cube1与cube3是否相等：" + cube1.equals(cube3));
        System.out.println("cube1与cube4是否相等：" + cube1.equals(cube4));

        System.out.println("cube1 hashCode equals cube2 hashCode: " + (cube1.hashCode() == cube2.hashCode())); // 应该返回true
        System.out.println("cube1 hashCode equals cube3 hashCode: " + (cube1.hashCode() == cube3.hashCode())); // 应该返回false


    }
}
